<html>
<head><meta charset="utf-8"><title>missing await diagnostic · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html">missing await diagnostic</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="168535011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168535011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168535011">(Jun 19 2019 at 18:50)</a>:</h4>
<p>Hello, I'm currently working on this issue <a href="https://github.com/rust-lang/rust/issues/61076" target="_blank" title="https://github.com/rust-lang/rust/issues/61076">https://github.com/rust-lang/rust/issues/61076</a> and in order to add the diagnostic I'm looking at including <code>Future</code> trait as a lang-item. A couple of people have mentioned that promoting an item to a lang-item is not normal just for a diagnostic; however, as the async/await syntax depends on the type it kind of makes sense to me that it should be a lang-item, but I really wasn't sure. If it were made a lang-item, the lang-item could be used throughout <code>hir::lowering</code> in place of the current paths into <code>std</code> which would be quite neat I think. I was wondering if anyone had any alternative/better ideas?</p>



<a name="168536370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168536370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168536370">(Jun 19 2019 at 19:04)</a>:</h4>
<p>When I'm working on a diagnostic PR, if I feel the only way to proceed is to make something a lang item, then I normally do and it's never been a problem. If doing so would unblock you to continue, then I'd go ahead and if there are objections during review, we can work out an alternative approach then.</p>
<p>As I understand it, lang items can't be used during <code>hir::lowering</code> because things haven't been assigned <code>DefId</code>s yet, though I might be mistaken there.</p>



<a name="168536374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168536374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168536374">(Jun 19 2019 at 19:04)</a>:</h4>
<p>Just my 2c.</p>



<a name="168536508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168536508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168536508">(Jun 19 2019 at 19:06)</a>:</h4>
<p>Ahh okay I hadn't realised the thing about <code>DefId</code>s, thanks a lot!</p>



<a name="168543742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168543742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168543742">(Jun 19 2019 at 20:40)</a>:</h4>
<p>So, I'm getting there, I just don't want to suggest <code>.await</code> in bodies that aren't <code>async</code>... Is there a way to check if a <code>hir::BodyId</code> is for an async body?</p>



<a name="168544129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168544129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168544129">(Jun 19 2019 at 20:45)</a>:</h4>
<p><span class="user-mention" data-user-id="225949">@Nathan Corbyn</span> you can use the <code>BodyId</code> to get the <code>Body</code>, which has a field called <code>generator_kind</code> that you can check (look for <code>Some(hir::GeneratorKind::Async)</code>)</p>



<a name="168544195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168544195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168544195">(Jun 19 2019 at 20:46)</a>:</h4>
<p>I actually can't find <code>GeneratorKind</code>...</p>



<a name="168544913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168544913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168544913">(Jun 19 2019 at 20:54)</a>:</h4>
<p><span class="user-mention" data-user-id="225949">@Nathan Corbyn</span> you'll need a relatively recent copy of rust-lang/rust</p>



<a name="168544924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168544924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168544924">(Jun 19 2019 at 20:54)</a>:</h4>
<p>like, from today</p>



<a name="168544936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168544936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168544936">(Jun 19 2019 at 20:54)</a>:</h4>
<p>or last night</p>



<a name="168546191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168546191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168546191">(Jun 19 2019 at 21:09)</a>:</h4>
<p>Got it! Thanks</p>



<a name="168546999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168546999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168546999">(Jun 19 2019 at 21:21)</a>:</h4>
<p><span class="user-mention" data-user-id="225949">@Nathan Corbyn</span> sure thing!</p>



<a name="168552903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168552903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168552903">(Jun 19 2019 at 23:02)</a>:</h4>
<p>(deleted)</p>



<a name="168628232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168628232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168628232">(Jun 20 2019 at 19:47)</a>:</h4>
<p>I was using this to check if the body of a <code>FnCtxt</code> is async, but it causes an ICE:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">body_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">hir</span><span class="p">().</span><span class="n">body_owned_by</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">body_id</span><span class="p">);</span><span class="w"></span>
<span class="kd">let</span><span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">hir</span><span class="p">().</span><span class="n">krate</span><span class="p">().</span><span class="n">body</span><span class="p">(</span><span class="n">body_id</span><span class="p">);</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">hir</span>::<span class="n">GeneratorKind</span>::<span class="n">Async</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">body</span><span class="p">.</span><span class="n">generator_kind</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>I was wondering if anyone knew what was wrong with it?</p>
<p>(This is the ICE: <code>error: internal compiler error: src/librustc/hir/map/mod.rs:455: body_owned_by: expr { take_u32(bar()) } (hir_id=HirId { owner: DefIndex(16), local_id: 8 }) has no associated body</code>)</p>



<a name="168635172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168635172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168635172">(Jun 20 2019 at 21:13)</a>:</h4>
<p>what is <code>self.body_id</code>? it doesn't look like it's a valid hir_id mapping a node with an associated body</p>



<a name="168635236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168635236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168635236">(Jun 20 2019 at 21:14)</a>:</h4>
<p>today, body owners are consts, statics, fns, methods, and closures</p>



<a name="168635300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168635300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168635300">(Jun 20 2019 at 21:15)</a>:</h4>
<p>It's a <code>hir::HirId</code> which is sort of confusing given the name</p>



<a name="168635476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168635476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168635476">(Jun 20 2019 at 21:17)</a>:</h4>
<p>You will want <code>self.inh.body_id</code></p>



<a name="168635535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168635535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168635535">(Jun 20 2019 at 21:18)</a>:</h4>
<p>Yeah I just spotted that, thanks!</p>



<a name="168636451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168636451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168636451">(Jun 20 2019 at 21:30)</a>:</h4>
<p>Actually, that looks like it's always the containing item, which is no help for a closure in an async fn.</p>



<a name="168636484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168636484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168636484">(Jun 20 2019 at 21:31)</a>:</h4>
<p>Could you give an example of what you mean?</p>



<a name="168636569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168636569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168636569">(Jun 20 2019 at 21:32)</a>:</h4>
<p><code>async fn foo() { || { /* can't use .await here, but ihn.body_id would refer to the outer function */ } }</code></p>



<a name="168636641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168636641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168636641">(Jun 20 2019 at 21:33)</a>:</h4>
<p>Ahh okay I see... This makes things complicated</p>



<a name="168636712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168636712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168636712">(Jun 20 2019 at 21:34)</a>:</h4>
<p>I'm trying to work on an reasonably exhaustive list of edge cases like this so I can write a decent test</p>



<a name="168638021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168638021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168638021">(Jun 20 2019 at 21:55)</a>:</h4>
<p>So, body_id looks like the body's HirId when we're checking an item with a body. The correct thing is something like:</p>
<div class="codehilite"><pre><span></span><span class="kd">let</span><span class="w"> </span><span class="n">item_id</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">hir</span><span class="p">().</span><span class="n">get_parent_node_by_hir_id</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">body_id</span><span class="p">);</span><span class="w"></span>
<span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">checked_body_id</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">hir</span><span class="p">().</span><span class="n">maybe_body_owned_by</span><span class="p">(</span><span class="n">item_id</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">tcx</span><span class="p">().</span><span class="n">hir</span><span class="p">().</span><span class="n">krate</span><span class="p">().</span><span class="n">body</span><span class="p">(</span><span class="n">body_id</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">hir</span>::<span class="n">GeneratorKind</span>::<span class="n">Async</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">body</span><span class="p">.</span><span class="n">generator_kind</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="c1">// ...</span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="168638129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168638129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168638129">(Jun 20 2019 at 21:56)</a>:</h4>
<p>Thank you so much, I'll give it a try!</p>



<a name="168767366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168767366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168767366">(Jun 22 2019 at 22:16)</a>:</h4>
<p>I'm just writing a test for this, should it go in the <code>test/ui/async-await/await-keyword</code> directory or the <code>test/ui/suggestions</code> directory?</p>



<a name="168792676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/168792676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#168792676">(Jun 23 2019 at 12:38)</a>:</h4>
<p>I’d throw it in async-await but I don’t think it will matter that much.</p>



<a name="169340290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/missing%20await%20diagnostic/near/169340290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nathan Corbyn <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/missing.20await.20diagnostic.html#169340290">(Jun 30 2019 at 13:36)</a>:</h4>
<p>I'm trying to extend this to work with chained expressions</p>
<p>Basically my idea so far is to introduce some logic here <a href="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc_typeck/check/method/suggest.rs#L306" target="_blank" title="https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc_typeck/check/method/suggest.rs#L306">https://github.com/rust-lang/rust/blob/c06f80a3c6988d28db43f0cff3f35d9a005c3ad5/src/librustc_typeck/check/method/suggest.rs#L306</a> that will deal with the case that we're looking at a future; however, ideally, I only want to suggest adding <code>.await</code> in cases where awaiting would actually yield a type with the unresolved item (not really sure how to do this)</p>
<p>Is this overkill (i.e. should I just suggest in potentially appropriate places and use <code>MaybeIncorrect</code>), or does anyone know how to retry type-checking after applying a suggestion? (Or at least checking if a type has a given associated item)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>